package com.hgk.common.common.ui.fragment;

import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.hgk.common.common.ui.activity.BallTitleAcitivty;
import com.hgk.common.common.ui.activity.listener.PlayingTitleListener;

import width.hgk.wanwan.R;


/**
 * Created by sam on 15/8/10.
 */
public abstract class TitleFragment extends BaseFragment implements PlayingTitleListener {

    protected TextView mTvTitle;
    protected BallTitleAcitivty mTitleActivity;
    protected PlayingTitleListener listener;

    protected Dialog mCustomDialog;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mTitleActivity= (BallTitleAcitivty) mContext;
        listener=this;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        init();
    }

    public void init(){
//        if(!TextUtils.isEmpty(listener.getTitleString()+"")) {
//            mTitleActivity.getViewTitle().getTextView().setText(listener.getTitleString() + "");
//        }
    }
    public void onCreateCustomDialog(View mDialogView) {
        if (mCustomDialog == null) {
            mCustomDialog = new Dialog(getActivity(), R.style.MyDialog);
        }
        mCustomDialog.setContentView(mDialogView);
        mCustomDialog.setCanceledOnTouchOutside(true);
        mCustomDialog.show();
    }

    public abstract int getBodyView();
}
